package com.ewem.code.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @auther KellyZeng
 * date 2022/1/2 22:28
 * @description:测试新增模块是否生效,加入注解component
 */
@Component
public class TestTwo {
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
//    @Scheduled(fixedDelayString= "2000")
    @Scheduled(cron = "0 23 10 * * *")
    public  void getThreadKelly(){
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println("@@@@@@"+simpleDateFormat.format(new Date()));
        String testName="kelly2";
        logger.info(" Kelly got DB that name isAI  {}", testName);
    }
}
